<div class="pd-20">
	<a class="btn btn-success" onclick="showSort('添加分类','{:U("Admin/Order/addSort")}','4','',450)">添加分类</a>
    <if condition="$sorts eq null ">
        <div class="row">没有订单，请添加分类</div>
        <else />
        <div class="mt-20">
        	
            <table class="table table-border table-bordered table-bg table-sort table-striped">
                <thead>
                    <tr class="text-c">
                        <th width="30">分类名称</th>
                        <th width="250">分类介绍</th>
                        <th width="80">{:C('pom_admin_product_name')}个数</th>
                        <th width="50">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <volist name="sorts" id="sort" key="k">
                        <tr class="text-c">
                            <td>{$sort.name}</td>
                            <td>{$sort.des}</td>
                            <td>{$sort.num}</td>
                            <td>
                            	<a class="btn btn-success" onclick="showSort('分类修改','{:U("Admin/Order/addSort",array("sid"=>$sort["id"]))}','4','',450)">修改</a>
                            	<a class="btn btn-success" onclick="showMsg({$sort['id']})">删除</a>
                            </td>
                        </tr>
                    </volist>
                </tbody>
            </table>
        </div>
    </if>
    <div class="row cl dataTables_wrapper">
        {$page}
    </div>
</div>
<script type="text/javascript" src="__PUBLIC__/lib/layer/layer.js"></script>
<script>
//用户-编辑
function showSort(title, url, id, w, h) {
    layer_show(title, url, w, h);
}

function showMsg(sid) {
	var res = confirm("将删除此分类下所有的{:C('pom_admin_product_name')}！");
	if(res == true) {
		window.location.href = '{:U("Admin/Order/delSort")}'+sid;
	} 
}

</script>
